package com.wsx.first.c;


import java.util.Scanner;

/**
 * @author: wangshunxi
 * @date: 2022/5/10 16:22
 * @Description:
 */
public class Main0006 {

    public static void main(String[] args) {
        try (Scanner scanner = new Scanner(System.in)) {
            int content = scanner.nextInt();

            solution(content);
        }
    }

    private static void solution(int content) {
        int temp = content;
        if (check(content)) {
            System.out.print(content);
            System.out.print(" ");
            return;
        }
        for (int i = 2; i <= (int) Math.sqrt(content); i++) {
            if (check(i) && temp % i == 0) {
                temp /= i;
                System.out.print(i);
                System.out.print(" ");
                solution(temp);
                return;
            }
        }


    }

    private static boolean check(int i) {
        for (int j = 2; j <= Math.sqrt(i); j++) {
            if (i % j == 0 && i != j && i >= 2) {
                return false;
            }
        }
        return true;
    }
}
